﻿@model Beeldbankmvc.Models.EditAccountModel
@using Beeldbankmvc.Code
@{
    ViewBag.Title = "Gebruiker aanpassen";
    Layout = "~/Views/Shared/Layout.cshtml";
    Html.RenderAction("AdminMenu", "Miscellaneous");
}

<h1>@ViewBag.Title</h1>
<script src="@AppHelper.getContent("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@AppHelper.getContent("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)

string header = null;
if (Model != null)
{
    if (Model.Header != null) { header = Model.Header; }
}

string country = null;
if (Model != null)
{
    if (Model.Country != null) { country = Model.Country; }
}

string factuurLand = null;
if (Model != null)
{
    if (Model.FactuurLand != null) { factuurLand = Model.FactuurLand; }
}  

    <fieldset>
    <legend style="display: none;">Velden</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.UserId)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.UserId)
            @Html.ValidationMessageFor(model => model.UserId)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Header)
        </div>
        <div class="editor-field">
            @Html.DropDownList("ddlHeader", new SelectList(ViewData["HeaderList"] as IEnumerable<SelectListItem>, "Value", "Text", header))
            @Html.ValidationMessageFor(model => model.Header)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.FirstName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.FirstName)
            @Html.ValidationMessageFor(model => model.FirstName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Prepositions)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Prepositions)
            @Html.ValidationMessageFor(model => model.Prepositions)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.LastName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.LastName)
            @Html.ValidationMessageFor(model => model.LastName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Email)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Email)
            @Html.ValidationMessageFor(model => model.Email)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Phone)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Phone)
            @Html.ValidationMessageFor(model => model.Phone)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Address)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Address)
            @Html.ValidationMessageFor(model => model.Address)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.AddressNr)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.AddressNr)
            @Html.ValidationMessageFor(model => model.AddressNr)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ZipCode)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ZipCode)
            @Html.ValidationMessageFor(model => model.ZipCode)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.City)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.City)
            @Html.ValidationMessageFor(model => model.City)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Country)
        </div>
        <div class="editor-field">
            @Html.DropDownList("ddlCountry", new SelectList(ViewData["CountryList"] as IEnumerable<SelectListItem>, "Value", "Text", country))
            @Html.ValidationMessageFor(model => model.Country)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.CompanyName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.CompanyName)
            @Html.ValidationMessageFor(model => model.CompanyName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.FactuurAddress)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.FactuurAddress)
            @Html.ValidationMessageFor(model => model.FactuurAddress)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.FactuurAddressNr)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.FactuurAddressNr)
            @Html.ValidationMessageFor(model => model.FactuurAddressNr)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.FactuurZipCode)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.FactuurZipCode)
            @Html.ValidationMessageFor(model => model.FactuurZipCode)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.FactuurCity)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.FactuurCity)
            @Html.ValidationMessageFor(model => model.FactuurCity)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.FactuurLand)
        </div>
        <div class="editor-field">
            @Html.DropDownList("ddlFactuurLand", new SelectList(ViewData["CountryList"] as IEnumerable<SelectListItem>, "Value", "Text", factuurLand))
            @Html.ValidationMessageFor(model => model.FactuurLand)
        </div>

        <div>
            <input type="submit" value="Save" />
            <a href="@Url.Action("Index", "Account")">
                <img alt="Terug naar het overzicht" title="Terug naar het overzicht" src="@AppHelper.getContent("~/Content/images/list.jpg")" />
                Terug naar het overzicht</a>
        </div>
    </fieldset>
}

